//
//  CaiculatorFootView.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/23.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "CaiculatorFootView.h"

@implementation CaiculatorFootView{
    GLGWLabel * caseLabel;
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        GLGWLabel * userCaseLabel = [[GLGWLabel alloc] initWithFont:BOLDSYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self];
        userCaseLabel.text = @"使用须知";
        [userCaseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(self.mas_top).offset(kHeightProportion_In_iPhoneTriploid(30));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        //
        caseLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        caseLabel.numberOfLines = 0;
        caseLabel.lineBreakMode = NSLineBreakByCharWrapping;
        caseLabel.preferredMaxLayoutWidth = KScreenWidth - kWidthProportion_In_iPhoneTriploid(30);
        caseLabel.attributedText = [GLGWLabel changeLineWithSpace:8 theInoutText:@"1、本工具计算的理论重量与实际重量有出入，误差约为0.2%-0.7%，s计算结果仅供参考，不建议在实际交易中使用。\n2、参考公式：\n理计长度L=w/0.00000785*d*w"];
        [caseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(userCaseLabel.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(10));
            make.right.equalTo(self.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(15));
        }];
    }
    return self;
}

-(void)setFormulaString:(NSString *)formulaString{
    _formulaString = formulaString;
    NSString * str = [NSString stringWithFormat:@"1、本工具计算的理论重量与实际重量有出入，误差约为0.2%-0.7%，s计算结果仅供参考，不建议在实际交易中使用。\n2、参考公式：\n%@",_formulaString];
//    @"1、本工具计算的理论重量与实际重量有出入，误差约为0.2%-0.7%，s计算结果仅供参考，不建议在实际交易中使用。\n2、参考公式：\n理计长度L=w/0.00000785*d*w"
    caseLabel.attributedText = [GLGWLabel changeLineWithSpace:8 theInoutText:str];
}

@end
